<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>个性卡片</title>
    <script src="../js/html2canvas.min.js"></script>
    
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        @font-face {
            font-family: 'MyFont';
            src: url('../font/MyFont-Regular.ttf') format('truetype');
            font-weight: normal;
            font-style: normal;
            font-display: swap;
        }
        
        body {
            background-color: #f9f7f1;
            padding: 40px 20px;
            max-width: 1200px;
            margin: 0 auto;
            transition: font-size 0.3s ease;
            font-size: 16px;
        }
        
        .control-panel {
            position: fixed;
            right: 20px;
            top: 50%;
            transform: translateY(-50%);
            background-color: white;
            border-radius: 8px;
            box-shadow: 0 4px 15px rgba(0,0,0,0.15);
            padding: 15px;
            z-index: 1000;
            display: flex;
            flex-direction: column;
            gap: 12px;
        }
        
        .control-btn {
            width: 45px;
            height: 45px;
            border: none;
            border-radius: 50%;
            background-color: #5d4037;
            color: white;
            font-size: 18px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.2s ease;
        }
        
        .control-btn:hover {
            transform: scale(1.1);
            background-color: #8d6e63;
        }
        
        .export-btn {
            background-color: #388e3c;
        }
        
        .export-btn:hover {
            background-color: #4caf50;
        }
        
        .header {
            text-align: center;
            margin-bottom: 60px;
            padding: 0 20px;
        }
        
        h1 {
            color: #5d4037;
            font-size: 2.625em; /* 使用相对单位 (16px * 2.625 = 42px) */
            margin-bottom: 25px;
            padding: 20px;
            display: inline-block;
            position: relative;
            font-family: 'MyFont', cursive;
            line-height: 1.5;
            background-color: rgba(255,255,255,0.7);
            border-radius: 8px;
            box-shadow: 0 4px 8px rgba(0,0,0,0.1);
        }
        
        .subtitle {
            color: #8d6e63;
            font-size: 1.875em; /* 16px * 1.875 = 30px */
            margin-bottom: 40px;
            text-align: center;
            font-family: 'MyFont', cursive;
        }
        
        .card-container {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
            gap: 35px;
            margin-bottom: 60px;
        }
        
        .card {
            padding: 35px;
            transition: all 0.4s ease;
            position: relative;
            overflow: hidden;
            border-radius: 8px;
            min-height: 180px;
            display: flex;
            align-items: center;
        }
        
        .card:hover {
            transform: translateY(-8px);
            box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
        }
        
        .card-text {
            font-size: 1.1875em; /* 16px * 1.1875 = 19px */
            line-height: 1.7;
            position: relative;
            z-index: 1;
            padding: 10px;
            outline: none;
        }

        /* 15个卡片的独特样式 */
        .card-1 {
            background-color: #fff3e0;
            box-shadow: 0 4px 12px rgba(251, 191, 36, 0.15);
            border-left: 6px solid #f57c00;
        }
        .card-1 .card-text {
            font-family: 'MyFont', cursive;
            color: #e65100;
        }

        .card-2 {
            background-color: #e8f5e9;
            box-shadow: 0 4px 12px rgba(76, 175, 80, 0.15);
            border-right: 6px solid #43a047;
        }
        .card-2 .card-text {
            font-family: 'MyFont', serif;
            color: #2e7d32;
        }

        .card-3 {
            background-color: #e3f2fd;
            box-shadow: 0 4px 12px rgba(33, 150, 243, 0.15);
            border-top: 6px solid #1976d2;
        }
        .card-3 .card-text {
            font-family: 'MyFont', cursive;
            color: #0d47a1;
        }

        .card-4 {
            background-color: #fce4ec;
            box-shadow: 0 4px 12px rgba(233, 30, 99, 0.15);
            border-bottom: 6px solid #c2185b;
        }
        .card-4 .card-text {
            font-family: 'MyFont', serif;
            color: #880e4f;
        }

        .card-5 {
            background-color: #f3e5f5;
            box-shadow: 0 4px 12px rgba(156, 39, 176, 0.15);
            border-left: 6px solid #8e24aa;
        }
        .card-5 .card-text {
            font-family: 'MyFont', serif;
            color: #4a148c;
        }

        .card-6 {
            background-color: #e0f7fa;
            box-shadow: 0 4px 12px rgba(0, 188, 212, 0.15);
            border-right: 6px solid #00acc1;
        }
        .card-6 .card-text {
            font-family: 'MyFont', cursive;
            color: #006064;
            font-size: 1.3125em; /* 16px * 1.3125 = 21px */
        }

        .card-7 {
            background-color: #fff8e1;
            box-shadow: 0 4px 12px rgba(255, 193, 7, 0.15);
            border-top: 6px solid #ffb300;
        }
        .card-7 .card-text {
            font-family: 'MyFont', serif;
            color: #ff8f00;
        }

        .card-8 {
            background-color: #ffebee;
            box-shadow: 0 4px 12px rgba(244, 67, 54, 0.15);
            border-bottom: 6px solid #d32f2f;
        }
        .card-8 .card-text {
            font-family: 'MyFont', cursive;
            color: #b71c1c;
        }

        .card-9 {
            background-color: #e8eaf6;
            box-shadow: 0 4px 12px rgba(63, 81, 181, 0.15);
            border-left: 6px solid #3949ab;
        }
        .card-9 .card-text {
            font-family: 'MyFont', serif;
            color: #283593;
        }

        .card-10 {
            background-color: #f1f8e9;
            box-shadow: 0 4px 12px rgba(124, 179, 66, 0.15);
            border-right: 6px solid #7cb342;
        }
        .card-10 .card-text {
            font-family: 'MyFont', cursive;
            color: #33691e;
        }

        .card-11 {
            background-color: #fff3e0;
            box-shadow: 0 4px 12px rgba(251, 146, 60, 0.15);
            border-top: 6px solid #f97316;
        }
        .card-11 .card-text {
            font-family: 'MyFont', serif;
            color: #e65100;
        }

        .card-12 {
            background-color: #ede7f6;
            box-shadow: 0 4px 12px rgba(103, 58, 183, 0.15);
            border-bottom: 6px solid #7b1fa2;
        }
        .card-12 .card-text {
            font-family: 'MyFont', serif;
            color: #4a148c;
        }

        .card-13 {
            background-color: #e0f2f1;
            box-shadow: 0 4px 12px rgba(0, 150, 136, 0.15);
            border-left: 6px solid #00897b;
        }
        .card-13 .card-text {
            font-family: 'MyFont', cursive;
            color: #004d40;
            font-size: 1.3125em; /* 21px */
        }

        .card-14 {
            background-color: #fafafa;
            box-shadow: 0 4px 12px rgba(158, 158, 158, 0.15);
            border-right: 6px solid #757575;
        }
        .card-14 .card-text {
            font-family: 'MyFont', cursive;
            color: #212121;
        }

        .card-15 {
            background-color: #fffde7;
            box-shadow: 0 4px 12px rgba(255, 235, 59, 0.15);
            border-top: 6px solid #fdd835;
        }
        .card-15 .card-text {
            font-family: 'MyFont', serif;
            color: #f57f17;
        }
        
        .conclusion-card {
            background: linear-gradient(135deg, #5d4037, #4e342e);
            color: #fff8e1;
            border-radius: 8px;
            padding: 40px;
            box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
            font-size: 1.375em; /* 22px */
            line-height: 1.8;
            position: relative;
        }
        
        .conclusion-title {
            font-weight: bold;
            margin-bottom: 25px;
            font-size: 1.75em; /* 28px */
            color: #ffcc80;
            font-family: 'MyFont', cursive;
        }
        
        .conclusion-card .content {
            font-family: 'MyFont', serif;
            outline: none;
        }

        /* 响应式调整 */
        @media (max-width: 768px) {
            .card-container {
                grid-template-columns: 1fr;
            }
            
            h1 {
                font-size: 2.125em; /* 34px */
            }
            
            .subtitle {
                font-size: 1.625em; /* 26px */
            }
            
            .control-panel {
                right: 10px;
            }
            
            .control-btn {
                width: 40px;
                height: 40px;
                font-size: 16px;
            }
        }
    </style>
</head>
<body>
    <!-- 控制面板 -->
    <div class="control-panel">
        <button class="control-btn" id="increaseFont">A+</button>
        <button class="control-btn" id="decreaseFont">A-</button>
        <button class="control-btn export-btn" id="exportImage">📷</button>
    </div>

    <div class="header">
        <h1 contenteditable="true">《这15句“搞钱真话”，骂醒了多少想躺平的人》</h1>
    </div>
    
    <div class="subtitle" contenteditable="true">【15条扎心励志金句】</div>
    
    <div class="card-container">
        <div class="card card-1">
            <div class="card-text" contenteditable="true">你所谓的迷茫，不过是清醒地看着沉沦。</div>
        </div>
        <div class="card card-2">
            <div class="card-text" contenteditable="true">只有赚钱的能力，不会背叛你。</div>
        </div>
        <div class="card card-3">
            <div class="card-text" contenteditable="true">所有假期快乐，都抵不过余额的底气。</div>
        </div>
        <div class="card card-4">
            <div class="card-text" contenteditable="true">你喊穷的时候，有人在通宵改方案。</div>
        </div>
        <div class="card card-5">
            <div class="card-text" contenteditable="true">羡慕别人的自由，先学会他的自律。</div>
        </div>
        <div class="card card-6">
            <div class="card-text" contenteditable="true">今天不想跑，所以才去跑——这才是搞钱逻辑。</div>
        </div>
        <div class="card card-7">
            <div class="card-text" contenteditable="true">你抱怨的996，是很多人求之不得的机会。</div>
        </div>
        <div class="card card-8">
            <div class="card-text" contenteditable="true">拖延最大的代价，不是浪费时间，是错过机会。</div>
        </div>
        <div class="card card-9">
            <div class="card-text" contenteditable="true">认知不够时，所有辛苦都是低水平重复。</div>
        </div>
        <div class="card card-10">
            <div class="card-text" contenteditable="true">人脉不是你认识谁，是谁愿意为你买单。</div>
        </div>
        <div class="card card-11">
            <div class="card-text" contenteditable="true">把“我不行”换成“我怎么才能行”。</div>
        </div>
        <div class="card card-12">
            <div class="card-text" contenteditable="true">赚钱最好的心态：只解决问题，不内耗情绪。</div>
        </div>
        <div class="card card-13">
            <div class="card-text" contenteditable="true">你下班后的4小时，决定你5年后的位置。</div>
        </div>
        <div class="card card-14">
            <div class="card-text" contenteditable="true">普通人最后一根稻草：敢把所有鸡蛋放在一个篮子。</div>
        </div>
        <div class="card card-15">
            <div class="card-text" contenteditable="true">不是厉害了才开始，是开始了才厉害。</div>
        </div>
    </div>
    
    <div class="conclusion-card">
        <div class="conclusion-title" contenteditable="true">【点睛结语】</div>
        <div class="content" contenteditable="true">这15句话，既是耳光，也是解药。收藏起来，撑不住的时候看一遍——世界上最美的风景，是亲手赚来的选择权。</div>
    </div>

    <script>
        // 字体大小控制 - 修复版
        let currentFontSize = 16; // 基础字体大小
        const fontSizeStep = 1;
        const maxFontSize = 24;
        const minFontSize = 12;
        
        // 放大字体
        document.getElementById('increaseFont').addEventListener('click', () => {
            if (currentFontSize < maxFontSize) {
                currentFontSize += fontSizeStep;
                document.body.style.fontSize = `${currentFontSize}px`;
            }
        });
        
        // 缩小字体
        document.getElementById('decreaseFont').addEventListener('click', () => {
            if (currentFontSize > minFontSize) {
                currentFontSize -= fontSizeStep;
                document.body.style.fontSize = `${currentFontSize}px`;
            }
        });
        
        // 导出长图功能
        document.getElementById('exportImage').addEventListener('click', () => {
            const controlPanel = document.querySelector('.control-panel');
            controlPanel.style.display = 'none';
            
            html2canvas(document.body, {
                scale: 2,
                useCORS: true,
                logging: false
            }).then(canvas => {
                controlPanel.style.display = 'flex';
                const link = document.createElement('a');
                link.download = '15句搞钱真话.png';
                link.href = canvas.toDataURL('image/png');
                link.click();
            }).catch(err => {
                controlPanel.style.display = 'flex';
                console.error('截图失败:', err);
                alert('导出失败，请重试');
            });
        });
    </script>
</body>
</html>
